﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class report__hour_main : System.Web.UI.Page
{
    DBClass _db = new DBClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Load_Department();
        }
    }
    protected void ddlDepartment_SelectedIndexChanged(object sender, EventArgs e)
    {
        Load_Section();
    }
    private void Load_Department()
    {
        ddlDepartment.DataSource = _db.GetList_Department();
        ddlDepartment.DataBind();
        ListItem item = new ListItem("----------select---------", "");
        ddlDepartment.Items.Insert(0, item);
    }
    private void Load_Section()
    {
        string item = ddlDepartment.SelectedValue.Replace(" ", "");
        DataTable dt = _db.GetList_Section(item);

        ddlSection.DataSource = dt;

        ddlSection.DataBind();
    }
}